gtk4.git
5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Sun, 15 Nov 2020 08:01:26 +0000 (08:01 +0000)]
Update Ukrainian translation

5 years agoMerge branch 'wip/carlosg/for-master' into 'master'
Matthias Clasen [Sat, 14 Nov 2020 14:41:01 +0000 (14:41 +0000)]
Merge branch 'wip/carlosg/for-master' into 'master'

gtk/main: Reset active state on grab broken only if implicit

See merge request GNOME/gtk!2832

5 years agogtk/main: Reset active state on grab broken only if implicit
Carlos Garnacho [Sat, 14 Nov 2020 09:48:04 +0000 (10:48 +0100)]
gtk/main: Reset active state on grab broken only if implicit

An implicit grab means some button is down, reset the active state
only in that case when we get a grab broken event.

Avoids active state accounting warnings when we do get active grabs
broken (e.g. after selecting a menu option).

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 14 Nov 2020 00:15:34 +0000 (00:15 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3359 and #3353

See merge request GNOME/gtk!2827

5 years agoAdwaita: Fix list separators
Matthias Clasen [Fri, 13 Nov 2020 22:18:05 +0000 (17:18 -0500)]
Adwaita: Fix list separators

Commit bfe5b0d1b7a1374964 ran into some specificity
trouble.

Fixes: #3353
5 years agolabel: Avoid short-circuiting
Matthias Clasen [Fri, 13 Nov 2020 20:35:51 +0000 (15:35 -0500)]
label: Avoid short-circuiting

Commit 0db504edde63eb77e made a mistake described here:
https://en.wikipedia.org/wiki/Short-circuit_evaluation#Possible_problems

Fixes: #3359
5 years agoMerge branch 'alatiera/nightly-demos' into 'master'
Matthias Clasen [Fri, 13 Nov 2020 19:28:44 +0000 (19:28 +0000)]
Merge branch 'alatiera/nightly-demos' into 'master'

ci: publish demo apps to the Nightly repository

See merge request GNOME/gtk!2825

5 years agoMerge branch 'wip/jimmac/tooltips' into 'master'
Matthias Clasen [Fri, 13 Nov 2020 19:23:58 +0000 (19:23 +0000)]
Merge branch 'wip/jimmac/tooltips' into 'master'

Adwaita: tooltip styling

Closes #3352

See merge request GNOME/gtk!2826

5 years agoci: publish demo apps to the Nightly repository
Jordan Petridis [Fri, 13 Nov 2020 18:00:17 +0000 (20:00 +0200)]
ci: publish demo apps to the Nightly repository

5 years agoAdwaita: tooltip styling
Jakub Steiner [Fri, 13 Nov 2020 18:36:26 +0000 (19:36 +0100)]
Adwaita: tooltip styling

- balance padding
- increase border radius, yuck
- get rid of text shadow

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3352

5 years agoMerge branch 'wip/jimmac/submenus' into 'master'
Jakub Steiner [Fri, 13 Nov 2020 17:05:00 +0000 (17:05 +0000)]
Merge branch 'wip/jimmac/submenus' into 'master'

Wip/jimmac/submenus

See merge request GNOME/gtk!2824

5 years agoMerge branch 'wip/jimmac/declare-buttonfill-once' into 'master'
Jakub Steiner [Fri, 13 Nov 2020 16:57:18 +0000 (16:57 +0000)]
Merge branch 'wip/jimmac/declare-buttonfill-once' into 'master'

Adwaita: double declated $button_fill

See merge request GNOME/gtk!2823

5 years agoAdwaita: rounded submenus
Jakub Steiner [Tue, 29 Sep 2020 10:54:25 +0000 (12:54 +0200)]
Adwaita: rounded submenus

- all corners have rounded corners

See https://gitlab.gnome.org/GNOME/gtk/-/issues/2745

5 years agoAdwaita: double declared $button_fill
Jakub Steiner [Fri, 13 Nov 2020 16:21:03 +0000 (17:21 +0100)]
Adwaita: double declared $button_fill

- this was already in place in _common, no need to have it in _colors

5 years agoAdwaita: double declated $button_fill
Jakub Steiner [Fri, 13 Nov 2020 16:21:03 +0000 (17:21 +0100)]
Adwaita: double declated $button_fill

- this was already in place in _common, no need to have it in _colors

5 years agoMerge branch 'wip/exalm/window' into 'master'
Jakub Steiner [Fri, 13 Nov 2020 15:33:15 +0000 (15:33 +0000)]
Merge branch 'wip/exalm/window' into 'master'

Round window corners

See merge request GNOME/gtk!1952

5 years agoMerge branch 'wip/carlosg/for-master' into 'master'
Matthias Clasen [Fri, 13 Nov 2020 04:13:34 +0000 (04:13 +0000)]
Merge branch 'wip/carlosg/for-master' into 'master'

Improve handling of ::active with touch and multiple foci

Closes #3348

See merge request GNOME/gtk!2821

5 years agogtk/main: Stack ::active calls
Carlos Garnacho [Thu, 12 Nov 2020 23:23:52 +0000 (00:23 +0100)]
gtk/main: Stack ::active calls

We may have the situation of multiple touchpoints in the same
widget, or combinations with other devices. Stack those ::active
states are preserved on widgets on all but the last pointer/touch
going away.

5 years agogtk/main: Toggle active flag with touch events
Carlos Garnacho [Thu, 12 Nov 2020 16:31:52 +0000 (17:31 +0100)]
gtk/main: Toggle active flag with touch events

This went missing at some point, add the missing toggling of active
state with GDK_TOUCH_BEGIN/END/CANCEL events.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3348
5 years agoMerge branch 'ebassi/for-master' into 'master'
Emmanuele Bassi [Thu, 12 Nov 2020 22:22:20 +0000 (22:22 +0000)]
Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

See merge request GNOME/gtk!2819

5 years agoa11y: Use GROUP role for ShortcutsShortcut
Emmanuele Bassi [Thu, 12 Nov 2020 21:12:56 +0000 (21:12 +0000)]
a11y: Use GROUP role for ShortcutsShortcut

And hide the image from the accessible tree.

5 years agoa11y: Implement atspi.Text.ScrollSubstringTo for GtkTextView
Emmanuele Bassi [Thu, 12 Nov 2020 20:57:56 +0000 (20:57 +0000)]
a11y: Implement atspi.Text.ScrollSubstringTo for GtkTextView

We reuse the existing implementation in GTK3.

5 years agoa11y: Document GtkRevealer's accessible state
Emmanuele Bassi [Thu, 12 Nov 2020 16:19:14 +0000 (16:19 +0000)]
a11y: Document GtkRevealer's accessible state

Use the GROUP role, and make sure to note that the child is always
revealed. Unlike GtkExpander, GtkRevealer can only be programmatically
toggled, so we cannot turn it into a "button" object.

5 years agoa11y: Add more accessible data to GtkTreeExpander
Emmanuele Bassi [Thu, 12 Nov 2020 16:16:48 +0000 (16:16 +0000)]
a11y: Add more accessible data to GtkTreeExpander

Document the role of the GtkTreeExpander, and the behaviour of the
expander button.

Additionally, improve the label of the expander button, by adding a
fixed "Expand" label, and setting the "labelled-by" relation to the
child of the GtkTreeExpander.

5 years agoEstablish a control relation between demo search and list
Emmanuele Bassi [Thu, 12 Nov 2020 16:12:03 +0000 (16:12 +0000)]
Establish a control relation between demo search and list

The search entry changes the content of the list view, so we should
mention that relation to assistive technologies.

5 years agoa11y: Add accessible actions to GtkSearchEntry
Emmanuele Bassi [Thu, 12 Nov 2020 16:05:31 +0000 (16:05 +0000)]
a11y: Add accessible actions to GtkSearchEntry

Just like GtkPasswordEntry, GtkSearchEntry should have its set of
accessible actions.

5 years agoa11y: Mark SearchEntry icons as presentational
Emmanuele Bassi [Thu, 12 Nov 2020 16:04:30 +0000 (16:04 +0000)]
a11y: Mark SearchEntry icons as presentational

While the "clear the search entry" icon behaves like a button, we don't
have any actual action that can trigger it, so let's ignore it.

5 years agoa11y: Set the role on GtkSearchBar
Emmanuele Bassi [Thu, 12 Nov 2020 14:54:39 +0000 (14:54 +0000)]
a11y: Set the role on GtkSearchBar

The search bar widget has a "SEARCH" landmark role, which is described
as:

    A landmark region that contains a collection of items and
    objects that, as a whole, combine to create a search facility.

5 years agoa11y: Icons in buttons are presentational
Emmanuele Bassi [Thu, 12 Nov 2020 14:53:16 +0000 (14:53 +0000)]
a11y: Icons in buttons are presentational

Buttons are described by text, and the icon child can be safely ignored.

5 years agoa11y: Add more accessibility labels to GtkNotebook
Emmanuele Bassi [Thu, 12 Nov 2020 14:51:58 +0000 (14:51 +0000)]
a11y: Add more accessibility labels to GtkNotebook

Label the various components:

 - the tab list
 - the tab widget
 - the arrow widgets

5 years agoa11y: Use the stack page title as its accessible label
Emmanuele Bassi [Thu, 12 Nov 2020 14:50:49 +0000 (14:50 +0000)]
a11y: Use the stack page title as its accessible label

5 years agoa11y: GtkStack is a group of stack pages
Emmanuele Bassi [Thu, 12 Nov 2020 14:50:35 +0000 (14:50 +0000)]
a11y: GtkStack is a group of stack pages

5 years agoHandle empty stack pages when creating an ATContext
Emmanuele Bassi [Thu, 12 Nov 2020 16:48:03 +0000 (16:48 +0000)]
Handle empty stack pages when creating an ATContext

If we don't have a widget inside GtkStackPage, we should use the default
GdkDisplay.

5 years agoUnrealize the ATContext in StackPage on dispose
Emmanuele Bassi [Thu, 12 Nov 2020 14:49:16 +0000 (14:49 +0000)]
Unrealize the ATContext in StackPage on dispose

Otherwise we're going to try to unrealize it during the GtkStack
destruction, which will emit warnings.

5 years agoa11y: Icons in WindowControls are presentational only
Emmanuele Bassi [Thu, 12 Nov 2020 14:48:15 +0000 (14:48 +0000)]
a11y: Icons in WindowControls are presentational only

They don't contribute anything to the accessible description.

5 years agoa11y: Ignore more structural roles when computing labels
Emmanuele Bassi [Thu, 12 Nov 2020 14:38:01 +0000 (14:38 +0000)]
a11y: Ignore more structural roles when computing labels

These roles should not have a fallback name when explicitly unlabelled.

5 years agoa11y: Add role exception for GtkScrolledWindow
Emmanuele Bassi [Thu, 12 Nov 2020 14:37:21 +0000 (14:37 +0000)]
a11y: Add role exception for GtkScrolledWindow

ARIA does not have a "scroll pane" role, but AT-SPI does.

5 years agodemo: Add more accessibility labels to the UI
Emmanuele Bassi [Thu, 12 Nov 2020 14:36:59 +0000 (14:36 +0000)]
demo: Add more accessibility labels to the UI

5 years agoMerge branch 'clear-search-entry' into 'master'
Matthias Clasen [Thu, 12 Nov 2020 19:25:57 +0000 (19:25 +0000)]
Merge branch 'clear-search-entry' into 'master'

searchbar: Fix clearing search entry on hide

See merge request GNOME/gtk!2820

5 years agosearchbar: Fix clearing search entry on hide
Florian Müllner [Thu, 12 Nov 2020 18:04:42 +0000 (19:04 +0100)]
searchbar: Fix clearing search entry on hide

Commit fa3d1940bf2b36 added separate grab handling for GtkSearchEntry, but
didn't consider whether the bar was revealed or concealed. The expected
behavior for the latter is that the entry is cleared rather than focused,
fix the condition accordingly.

5 years agotheme: Round all window corners
Alexander Mikhaylenko [Thu, 12 Nov 2020 17:19:00 +0000 (22:19 +0500)]
theme: Round all window corners

5 years agotheme: Restructure window style
Alexander Mikhaylenko [Thu, 12 Nov 2020 17:17:52 +0000 (22:17 +0500)]
theme: Restructure window style

5 years agoMerge branch 'ebassi/for-master' into 'master'
Matthias Clasen [Thu, 12 Nov 2020 12:35:23 +0000 (12:35 +0000)]
Merge branch 'ebassi/for-master' into 'master'

ATContext lifetime fixes

Closes #3341

See merge request GNOME/gtk!2811

5 years agoMerge branch 'wip/jimmac/sassc-global-vars' into 'master'
Jakub Steiner [Thu, 12 Nov 2020 12:34:10 +0000 (12:34 +0000)]
Merge branch 'wip/jimmac/sassc-global-vars' into 'master'

Adwaita: avoid !global

See merge request GNOME/gtk!2816

5 years agoAdwaita: avoid !global
Jakub Steiner [Thu, 12 Nov 2020 12:14:37 +0000 (13:14 +0100)]
Adwaita: avoid !global

- Work around having !global variables as sassc will
  no longer support it

5 years agodocs: Add "Accessibility" section to various widgets
Emmanuele Bassi [Thu, 12 Nov 2020 00:36:32 +0000 (00:36 +0000)]
docs: Add "Accessibility" section to various widgets

There are a few widgets that gained an accessible role, which means
adding an "Accessibility" section in their description.

5 years agoMerge branch 'suggestion-entry-demo2' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 21:40:07 +0000 (21:40 +0000)]
Merge branch 'suggestion-entry-demo2' into 'master'

gtk-demo: Add suggestion entry demos

See merge request GNOME/gtk!2812

5 years agogtk-demo: Add suggestion entry demos
Matthias Clasen [Thu, 25 Jun 2020 17:57:17 +0000 (13:57 -0400)]
gtk-demo: Add suggestion entry demos

Add a possible replacement for GtkEntryCompletion
as a demo.

Move the Dropdowns demo to Lists/Selections, and make
it show both GtkDropDown and the suggestion entry, with
some variations.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 20:49:51 +0000 (20:49 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2810

5 years agoa11y: Simplify GtkModelButton
Emmanuele Bassi [Wed, 11 Nov 2020 18:31:32 +0000 (18:31 +0000)]
a11y: Simplify GtkModelButton

Instead of recreating GtkATContexts in order to change their role, we
can simply unrealize and realize them back.

5 years agoa11y: Add missing fallback for accessible-role getter
Emmanuele Bassi [Wed, 11 Nov 2020 19:36:38 +0000 (19:36 +0000)]
a11y: Add missing fallback for accessible-role getter

If the per-instance accessible role is unset, use the class role.

5 years agoa11y: Rework ownership and lifetime of GtkATContext
Emmanuele Bassi [Wed, 11 Nov 2020 18:17:41 +0000 (18:17 +0000)]
a11y: Rework ownership and lifetime of GtkATContext

Now that GtkATContext is explicitly realized and unrealized, we should
always create an instance at widget initialization time, and drop it
during the widget finalization. This should make it easier to set up the
initial accessible state of a widget during the instance initialization,
as well as reduce the chances of accidental creation of GtkATContext
instances during the destruction sequence.

5 years agoa11y: Defer to the GtkAccessible's implementation
Emmanuele Bassi [Wed, 11 Nov 2020 19:37:26 +0000 (19:37 +0000)]
a11y: Defer to the GtkAccessible's implementation

Since GtkATContexts are now lazily realized, we need to go through the
GtkAccessible's implementation to access the :accessible-role property,
in case there are fallbacks.

5 years agoa11y: Create AtSpiRoot on realization
Emmanuele Bassi [Wed, 11 Nov 2020 18:15:18 +0000 (18:15 +0000)]
a11y: Create AtSpiRoot on realization

There's no need to do a lot of work on construction, if we're delaying
all remote work after the GtkATContext is realized.

The GtkAtSpiContext should also keep a reference on the root, and drop
it at unrealize time.

5 years agoa11y: Use GROUP role for GtkNotebook
Emmanuele Bassi [Wed, 11 Nov 2020 18:11:10 +0000 (18:11 +0000)]
a11y: Use GROUP role for GtkNotebook

A notebook is a grouping of a tab list, tabs, and tab pages.

5 years agoa11y: Protect should_present() from empty contexts
Emmanuele Bassi [Wed, 11 Nov 2020 18:09:43 +0000 (18:09 +0000)]
a11y: Protect should_present() from empty contexts

If the GtkAccessible implementation returns a NULL context, we should
not be calling methods on it.

5 years agoa11y: Do not leak the ATContext in GtkStackPage
Emmanuele Bassi [Wed, 11 Nov 2020 18:08:16 +0000 (18:08 +0000)]
a11y: Do not leak the ATContext in GtkStackPage

GtkStackPage is not a widget, so it must release the reference on the
ATContext it owns.

5 years agoa11y: Mark more containers as structural elements
Emmanuele Bassi [Wed, 11 Nov 2020 17:54:57 +0000 (17:54 +0000)]
a11y: Mark more containers as structural elements

Widgets that just provide grouping and layout to other widgets should
not be relevant to the accessible tree.

5 years agoa11y: Use the window title as its label
Emmanuele Bassi [Wed, 11 Nov 2020 17:51:56 +0000 (17:51 +0000)]
a11y: Use the window title as its label

5 years agoa11y: Skip unlabelled structural roles
Emmanuele Bassi [Wed, 11 Nov 2020 17:50:42 +0000 (17:50 +0000)]
a11y: Skip unlabelled structural roles

If a structural role is left unlabelled, just leave it unnamed.

5 years agoa11y: Translate ARIA windows to AT-SPI frames
Emmanuele Bassi [Wed, 11 Nov 2020 17:49:38 +0000 (17:49 +0000)]
a11y: Translate ARIA windows to AT-SPI frames

For backward compatibility with GTK3.

5 years agoa11y: Add more ARIA/AT-SPI role translations
Emmanuele Bassi [Wed, 11 Nov 2020 17:49:14 +0000 (17:49 +0000)]
a11y: Add more ARIA/AT-SPI role translations

5 years agoa11y: Realize parent ATContext for the stack page
Emmanuele Bassi [Wed, 11 Nov 2020 17:45:32 +0000 (17:45 +0000)]
a11y: Realize parent ATContext for the stack page

Just like for popovers, the stack page is not directly connected on the
widget's DOM, so we need to realize the parent ATContext ourselves.

5 years agoa11y: Implement missing atspi.Component getters
Emmanuele Bassi [Wed, 11 Nov 2020 17:43:44 +0000 (17:43 +0000)]
a11y: Implement missing atspi.Component getters

Some of them are entirely innocuous, and we can easily provide values
that match what GTK3 provides.

5 years agoa11y: Unrealize ATContext on dispose()
Emmanuele Bassi [Tue, 10 Nov 2020 17:18:55 +0000 (17:18 +0000)]
a11y: Unrealize ATContext on dispose()

By unrealizing the context we avoid additional work during the dispose
phase, in case widget code updates the accessible state. We use
GtkAccessible's API, to ensure we unrealize the right ATContext, instead
of the one we store inside GtkWidgetPrivate.

We drop the ATContext instance inside GtkWidget during finalization, to
mop up eventual vivifications there.

5 years agoAdwaita: Don't do n-th child things for list rows
Matthias Clasen [Wed, 11 Nov 2020 18:07:31 +0000 (13:07 -0500)]
Adwaita: Don't do n-th child things for list rows

Making the list row child css depend on the position
is very expensive, and does not acutally work correctly
(since we don't have widgets for all children, so the
position of the child widget does not reflect the actual
model item position).

To make this more palatable, use the bottom border
instead of the top border, since most lists have a natural
border at the top (with headers), and may end up with
empty space at the bottom.

5 years agolabel: Avoid a needless strdup
Matthias Clasen [Wed, 11 Nov 2020 17:24:35 +0000 (12:24 -0500)]
label: Avoid a needless strdup

Don't duplicate the string before we know if it
has actually changed.

5 years agolabel: Optimize GtkLabel setters
Matthias Clasen [Wed, 11 Nov 2020 15:35:09 +0000 (10:35 -0500)]
label: Optimize GtkLabel setters

The overarching goal here is to not queue a resize
unless something has actually changed. In columnview
scenarios, we often deal with hundreds of labels.

Labels are cattle, not pets.

5 years agogtk-demo: Split off SvgPaintable
Matthias Clasen [Tue, 10 Nov 2020 21:12:16 +0000 (16:12 -0500)]
gtk-demo: Split off SvgPaintable

Put the SvgPaintable implementation into its
own source files, for ease of copying.

5 years agoDon't hide widgets in dispose()
Matthias Clasen [Tue, 10 Nov 2020 20:07:07 +0000 (15:07 -0500)]
Don't hide widgets in dispose()

This is leftover code from when widgets were hidden
by default, and was setting them back to their initial
state.

This is getting in the way now, as hiding the widget
updates the HIDDEN accessible state, which ends up
re-creating the at context that we've already disposed
of, leading to memory leaks.

5 years agoMerge branch 'matthiasc/builder-requires' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 03:53:52 +0000 (03:53 +0000)]
Merge branch 'matthiasc/builder-requires' into 'master'

Matthiasc/builder requires

See merge request GNOME/gtk!2806

5 years agoMerge branch 'fix-demos-wo-pangoft2' into 'master'
Matthias Clasen [Wed, 11 Nov 2020 03:50:46 +0000 (03:50 +0000)]
Merge branch 'fix-demos-wo-pangoft2' into 'master'

gtk-demo: Fix building scrolling demo without PangoFT2

See merge request GNOME/gtk!2807

5 years agogtk-demo: Fix building scrolling demo without PangoFT2
Chun-wei Fan [Wed, 11 Nov 2020 03:08:38 +0000 (11:08 +0800)]
gtk-demo: Fix building scrolling demo without PangoFT2

For builds that do not have PangoFT2, the demo fails to link because we weren't
building listview_ucd.c.  Fix the build by building listview_ucd.c with
script-names.c and unicode-names.c for all builds, as we now require a Pango
version that already always depends on HarfBuzz and those sources do not use
anything from PangoFT2.

5 years agotestsuite: Update buildertool tests
Matthias Clasen [Wed, 11 Nov 2020 00:20:51 +0000 (19:20 -0500)]
testsuite: Update buildertool tests

gtk-builder-tool simplify --3to4 now produces a
<requires lib="gtk" version="4.0"/>.
Adapt for that, and also add some tests that check that we
actually verify the requires, and accept 3.99 and 4.0, but
not 5.x.

5 years agobuildertool: Supplant a requires
Matthias Clasen [Wed, 11 Nov 2020 00:19:40 +0000 (19:19 -0500)]
buildertool: Supplant a requires

When we convert a ui file to GTK 4 syntax, we *know*
that it requires GTK 4, so put that in the output.

5 years agobuilder: Be a bit more strict about requires
Matthias Clasen [Wed, 11 Nov 2020 00:18:26 +0000 (19:18 -0500)]
builder: Be a bit more strict about requires

Check that the major version matches (without this, the
requires check is really toothless), but allow 3.99 to
match 4.0.

5 years agotestsuite: Remove <requires> from ui files
Matthias Clasen [Wed, 11 Nov 2020 00:17:45 +0000 (19:17 -0500)]
testsuite: Remove <requires> from ui files

We don't need these here, the testsuite is shipped
with GTK.

5 years agoexamples: Remove requires from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:38:54 +0000 (18:38 -0500)]
examples: Remove requires from ui files

No need to check requires for things that are shipped
with GTK.

5 years agogtk4-demo: Remove <requires> from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:37:40 +0000 (18:37 -0500)]
gtk4-demo: Remove <requires> from ui files

No need to check requires for things that are shipped
with GTK.

5 years agogtk: Remove <requires> from ui files
Matthias Clasen [Tue, 10 Nov 2020 23:36:03 +0000 (18:36 -0500)]
gtk: Remove <requires> from ui files

We don't need to check requirements for things
that are shipped *with* gtk.

5 years agoMerge branch 'ebassi/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 18:33:36 +0000 (18:33 +0000)]
Merge branch 'ebassi/for-master' into 'master'

Ebassi/for master

Closes #3343 and #3342

See merge request GNOME/gtk!2804

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 16:59:47 +0000 (16:59 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2805

5 years agodocs: Add example of relations with lists of references
Emmanuele Bassi [Tue, 10 Nov 2020 14:38:09 +0000 (14:38 +0000)]
docs: Add example of relations with lists of references

5 years agoa11y: Clone GtkATContext in GtkModelButton
Emmanuele Bassi [Tue, 10 Nov 2020 14:21:32 +0000 (14:21 +0000)]
a11y: Clone GtkATContext in GtkModelButton

The hypothetical widget that needs to clone ATContext instances
because it needs to control the accessible role post-construction is
really GtkModelButton.

Fixes: #3342
5 years agoa11y: Add private API to clone a GtkATContext
Emmanuele Bassi [Tue, 10 Nov 2020 14:19:32 +0000 (14:19 +0000)]
a11y: Add private API to clone a GtkATContext

Some widgets might want to override GtkAccessible and create their own
context in order to control the accessible role post-construction time.
To avoid explicitly copying the existing state over from the original
ATContext to the new one, we need a way to clone the context's state
from inside the ATContext itself.

5 years agoa11y: Do not copy the list of references
Emmanuele Bassi [Tue, 10 Nov 2020 14:17:11 +0000 (14:17 +0000)]
a11y: Do not copy the list of references

The constructor for GtkReferenceListAccessibleValue is transfer full,
which means we should not be copying the GList around.

Fixes: #3343
5 years agoa11y: Parse reference lists using varargs
Emmanuele Bassi [Tue, 10 Nov 2020 14:14:47 +0000 (14:14 +0000)]
a11y: Parse reference lists using varargs

Using GList is a bit lame, and makes the API more complicated to use
than necessary in the common case.

The only real use case for a GList is gtk_widget_add_mnemonic_label(),
and for that we can use the GValue-based API instead.

Fixes: #3343
5 years agoa11y: Add GValue initializers for accessible attributes
Emmanuele Bassi [Tue, 10 Nov 2020 14:08:16 +0000 (14:08 +0000)]
a11y: Add GValue initializers for accessible attributes

Consumers of the GValue-based API for GtkAccessible need to have a way
to initialize the GValue with the correct type for the given attribute.

5 years agoa11y: Proxy GtkWidget:accessible-role
Emmanuele Bassi [Tue, 10 Nov 2020 11:02:35 +0000 (11:02 +0000)]
a11y: Proxy GtkWidget:accessible-role

The accessible-role property in GtkWidget has three possible targets:

 - the :accessible-role of a GtkATContext, if realized
 - the accessible_role field of GtkWidgetPrivate
 - the accessible_role field of GtkWidgetClassPrivate

When we set the accessible role of a widget using the GObject property
mechanism, we want to either set the GtkWidgetPrivate.accessible_role
field, if there's no ATContext *or* if the ATContext is not realized.
Conversely, when we get the accessible-role property we want to have a
series of fallbacks in place:

 - if GtkAccessible.get_at_context() returns an ATContext, and that
   ATContext is realized, return the :accessible-role of the context
 - if GtkWidgetPrivate.accessible_role is not WIDGET, return the
   stored accessible role
 - return GtkWidgetClassPrivate.accessible_role

This should help catch the case of getting the accessible role of
widgets that override GtkAccessible.get_at_context(), like
GtkModelButton.

See: #3342

5 years agoprintdialog: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:54 +0000 (09:07 -0500)]
printdialog: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agofontchooser: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:40 +0000 (09:07 -0500)]
fontchooser: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agocolumnview: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:22 +0000 (09:07 -0500)]
columnview: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agox11: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:07:01 +0000 (09:07 -0500)]
x11: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agowin32: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:06:37 +0000 (09:06 -0500)]
win32: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agowayland: Plug listmodel memory leaks
Matthias Clasen [Tue, 10 Nov 2020 14:05:55 +0000 (09:05 -0500)]
wayland: Plug listmodel memory leaks

We were leaking references returned from g_list_model_get_item
in some places.

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 10 Nov 2020 08:15:59 +0000 (08:15 +0000)]
Update Ukrainian translation

5 years agoUpdate Ukrainian translation
Yuri Chornoivan [Tue, 10 Nov 2020 07:58:38 +0000 (07:58 +0000)]
Update Ukrainian translation

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Tue, 10 Nov 2020 04:47:28 +0000 (04:47 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2803

5 years agogtk-demo: Plug a memory leak
Matthias Clasen [Tue, 10 Nov 2020 02:04:52 +0000 (21:04 -0500)]
gtk-demo: Plug a memory leak

5 years agogtk-demo: Tweak a demo title
Matthias Clasen [Tue, 10 Nov 2020 01:07:09 +0000 (20:07 -0500)]
gtk-demo: Tweak a demo title